package cn.itcast.bos.system.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import cn.itcast.bos.domain.security.Menu;

public interface MenuDao extends JpaRepository<Menu, Integer>{

	@Query("from Menu m where m.id in :menuIds")
	List<Menu> getMenuByIds(@Param("menuIds")Integer[] menuIds);

	@Query("from Menu m inner join fetch m.roles r inner join fetch r.users u where u.id=:id ")
	List<Menu> showMenusByUserId(@Param("id")Integer id);


	

}
